<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLogPlayerBetFlowTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('log_player_bet_flow', function (Blueprint $table) {
            $table->integer('id', true);
            $table->string('username')->index('username')->comment('玩家id');
            $table->string('site_username')->nullable()->index('site_username')->comment('站点用户名');
            $table->string('game_code')->nullable()->comment('游戏ID');
            $table->string('main_game_plat_code')->nullable()->comment('主平台代码');
            $table->string('game_flow_code', 60)->nullable()->unique('game_flow_code')->comment('游戏流水号');
            $table->decimal('bet_amount', 10)->nullable()->comment('下注金额');
            $table->decimal('available_bet_amount', 10)->nullable()->comment('有效投注额');
            $table->decimal('company_payout_amount', 10)->nullable()->comment('公司派彩');
            $table->decimal('company_win_amount', 10)->nullable()->comment('公司输赢');
            $table->string('plat_type', 32)->nullable()->comment('平台类型');
            $table->string('lobby_type', 32)->nullable()->comment('大厅类型');
            $table->string('line', 32)->nullable()->comment('平台线路');
            $table->string('bet_detail', 512)->nullable()->comment('投注详情');
            $table->string('result', 512)->nullable()->comment('结果');
            $table->string('round_code', 64)->nullable()->comment('局号');
            $table->boolean('bet_flow_available')->nullable()->comment('1=有效，0=无效');
            $table->boolean('status')->nullable()->comment('1=已结算，0=未结算。-1=已注销');
            $table->dateTime('bet_time')->nullable()->comment('投注时间');
            $table->dateTime('pull_at')->nullable()->comment('数据拉取时间');
            $table->text('api_data', 65535)->nullable()->comment('接口数据');
            $table->timestamps();
        }
        );
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('log_player_bet_flow');
    }

}
